home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Unix / cvs-960311 / lib / cvs / examples / comb < prev    next >
Encoding:
Text File  |  1995-07-24  |  764 b   |  20 lines

  1. #!/bin/sh
  2. #
  3. # Combine a directory into a single tar package.
  4. #
  5. # This script is always called with the current directory set to
  6. # where the file to be combined exists. but i may get called with a
  7. # path to where cvs first started executing. (this probably should be
  8. # fixed in cvs) so strip out all of the directory information. The
  9. # first sed expression will only work if the path has a leading /
  10. # if it doesn't the one in the if statement will work.
  11. DIRNAME=`echo $1 | sed -e "s|/.*/||g"`
  12. if [ ! -d $DIRNAME ] ; then
  13.       DIRNAME=`echo $1 | sed -e "s|.*/||g"`
  14. fi
  15. #
  16. # Now tar up the directory but we now will only get a relative path
  17. # even if the user did a cvs commit . at the top.
  18. #
  19. gnutar --preserve --sparse -cf - $DIRNAME | gzip --no-name --best -c > $2
  20.